package com.zatech.cgnci.project.base.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.Objects;

/**
 * 理赔任务类型
 */
@Getter
@AllArgsConstructor
public enum ClaimFlowEnum {
    CLAIM_CASE("claim_case", "立案任务流程"),
    CLAIM_RESERVE("claim_reserve", "准备金任务流程"),
    CLAIM_PREPAY("claim_prepay", "预付申请任务流程"),
    CLAIM_SETTLEMENT("claim_settlement", "结案任务流程"),
    CLAIM_REOPEN("claim_reopen", "案件重开任务流程"),

    ;

    public static ClaimFlowEnum getEnumByCode(String code) {
        return Arrays.stream(values()).filter(e -> Objects.equals(e.getCode(), code)).findAny().orElse(null);
    }

    private String code;
    private String name;
}
